
enum Gender {
  Unknown = 0,
  Male = 1,
  Female = 2
}

interface ID {
  id: int;
}

interface GetParams {
  page?: int;
  pageSize?: int;
}

interface User {
  userName: string;
  name: string;
  gender: Gender;
  role: string;
}

type UserEntry = User & {
  uid: int;
};

interface Supplier {
  name: string;
  contact: string;
  phone: string;
  email: string;
  address: string;
}

type SupplierEntry = Supplier & ID;

interface Commodity {
  name: string;
  wholesalePrice: float;
  retailPrice: float;
  costPrice: float;
  notes: string;
}

type CommodityEntry = Commodity & ID;

interface Warehouse {
  name: string;
  type: string;
  address: string;
}

type WarehouseEntry = Warehouse & ID;

interface InventoryEntry {
  id: int;
  commodityId: int;
  commodityName: string;
  supplierName: string;
  quantity: number;
  costPrice: number;
}

interface PageInfo<T> {
  data: T[];
  total: int;
}

type int = number;
type double = number;
type float = number;

export type { GetParams, UserEntry, SupplierEntry, Supplier, User, Commodity, CommodityEntry, Warehouse, WarehouseEntry, InventoryEntry, PageInfo };
export type { int, double, float };
export { Gender };